<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<title>addGoods.jsp</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
</head>    
<body>
   <div align="center">
   	<div style="width: 100%; text-align: center;font-weight: bold;font-size: 20px; padding: 10px;">添加商品</div>
	<form:form action="goods/addGoods" method="post" modelAttribute="goods" enctype="multipart/form-data" style="width: 30%;">
		<table class="table table-bordered">
			<!-- <caption>
				<font size=4 face=华文新魏>添加商品</font>
			</caption> -->
			<tr>
				<td>
					<img src="${pageContext.request.contextPath}/image/gname.png" style="width: 25px;height: 25px;background-position: center;background-size: cover;">
					<font color="red">*</font>
				</td>
				<td>
					<form:input path="gname" placeholder="名称" style="width:300px;" class="form-control"/><br>
					<form:errors path="gname" cssStyle="color:red"/>
				</td>
			</tr>
			<tr>
				<td>
					<img src="${pageContext.request.contextPath}/image/goprice.png" style="width: 25px;height: 25px;background-position: center;background-size: cover;">
					<font color="red">*</font>
				</td>
				<td>
					<form:input path="goprice" placeholder="原价" style="width:300px" class="form-control"/><br>
					<form:errors path="goprice" cssStyle="color:red"/>
				</td>
			</tr>
			<tr>
				<td>
					<img src="${pageContext.request.contextPath}/image/grprice.png" style="width: 25px;height: 25px;background-position: center;background-size: cover;">
					<font color="red">*</font>
				</td>
				<td>
					<form:input path="grprice" placeholder="折扣价" style="width:300px" class="form-control"/><br>
					<form:errors path="grprice" cssStyle="color:red"/>
				</td>
			</tr>
			<tr>
				<td>
					<img src="${pageContext.request.contextPath}/image/gstore.png" style="width: 25px;height: 25px;background-position: center;background-size: cover;">
					<font color="red">*</font>
				</td>
				<td>
					<form:input path="gstore" placeholder="库存" style="width:300px" class="form-control"/><br>
					<form:errors path="gstore" cssStyle="color:red"/>
				</td>
			</tr>
			<tr>
				<td>
					<img src="${pageContext.request.contextPath}/image/logoImage.png" style="width: 25px;height: 25px;background-position: center;background-size: cover;">
				</td>
				<td>
					<input type="file" name="logoImage"/>
				</td>
			</tr>
			<tr>
				<td>
					<img src="${pageContext.request.contextPath}/image/gtype.png" style="width: 25px;height: 25px;background-position: center;background-size: cover;">
				</td>
				<td>
					<form:select path="goodstype_id">
         				<form:options items="${goodsType }" itemLabel="typename" itemValue="id" path="goodsType"/>
   					</form:select>
				</td>
			</tr>
			<tr>
				<td></td>
				<td align="center">
					<input type="submit"  value="提 交" class="btn btn-primary"/>&nbsp;&nbsp;
					<input type="reset" value="重 置" class="btn btn-default"/>
				</td>
			</tr>
		</table>
	</form:form>
	</div>
</body>
</html>
